﻿using System.Web.UI;
using System.Web.UI.WebControls;
using Yd.CommCls;

namespace Yd.Util
{
    /// <summary>
    /// 分页用户控件的自定义类
    /// </summary>
    public partial class PageButton : UserControl
    {
        /// <summary>
        /// 设置当前总记录
        /// </summary>
        /// <param name="FlbCount"></param>
        public void SetlbCount(string FlbCount)
        {
            ((Literal)this.FindControl("lbCount")).Text = FlbCount;
        }

        public void Setlbhidcount(string hidcount)
        {
            ((HiddenField)this.FindControl("hidcount")).Value = hidcount;
        }

        public string getpage()
        {
            if (Request["page"] != null)
            {
                string s = Request["page"].Trim();
                return s.Split(',')[0].StrToInt().ToString();
            }
            return "1";
        }

        /// <summary>
        /// 设置当前首页的链接地址
        /// </summary>
        /// <param name="FhlnkHead"></param>
        public void SethlnkHead(string FhlnkHead)
        {
            ((HyperLink)this.FindControl("hlnkHead")).NavigateUrl = FhlnkHead;
        }

        /// <summary>
        /// 设置当前上一页的链接地址
        /// </summary>
        /// <param name="FhlnkPrev"></param>
        public void SethlnkPrev(string FhlnkPrev)
        {
            ((HyperLink)this.FindControl("hlnkPrev")).NavigateUrl = FhlnkPrev;
        }

        /// <summary>
        /// 设置当前下一页的链接地址
        /// </summary>
        /// <param name="FhlnkNext"></param>
        public void SethlnkNext(string FhlnkNext)
        {
            ((HyperLink)this.FindControl("hlnkNext")).NavigateUrl = FhlnkNext;
        }

        /// <summary>
        /// 设置当前尾页的链接地址
        /// </summary>
        /// <param name="FhlnkEnd"></param>
        public void SethlnkEnd(string FhlnkEnd)
        {
            ((HyperLink)this.FindControl("hlnkEnd")).NavigateUrl = FhlnkEnd;
        }

        /// <summary>
        /// 设置当前页
        /// </summary>
        /// <param name="FlbCurPage"></param>
        public void SetlbCurPage(string FlbCurPage)
        {
            ((Literal)this.FindControl("lbCurPage")).Text = FlbCurPage;
        }

        //新分页样式
        /// <summary>
        /// 设置当前页
        /// </summary>
        /// <param name="FlbCurPage"></param>
        public void SetlbCurPage_1(string FlbCurPage)
        {
            ((Literal)this.FindControl("lbCount_1")).Text = FlbCurPage;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="FlbCurPage"></param>
        public void Setfy_1(string FlbCurPage)
        {
            ((Literal)this.FindControl("fyinfo")).Text = FlbCurPage;
        }
    }
}
